import java.util.Scanner;

public class Test {
    //找出1~100的素数
    public static void main(String[] args) {
        for (int k = 1; k <= 100; k++) {
            for (int j = 2; j <= k / 2; j++) {
                if (k % j == 0) {
                    System.out.println("不是素数");
                }
            }
        }
    }


    //从键盘输入
    public static void main14(String[] args) {
        Scanner scan = new Scanner(System.in);  //固定格式表示从键盘输入
        int n = scan.nextInt();
        System.out.println(n);
    }

    //判断闰年
    public static void main13(String[] args) {
        for(int year = 1000; year <= 2000; year++) {
            if(year % 4 == 0 && year % 100 != 0) {
                    System.out.println(year);
            }else if(year % 100 == 0 && year % 400 == 0) {
                    System.out.println(year);
            }else {
            }
        }
    }


    //利用for循环来求阶乘的和
    public static void main12(String[] args) {
        int sum = 0;
        for (int m = 1; m <= 5; m++) {
            int ret = 1;
            for (int i = 1; i <= m; i++) {
                ret *= i;
            }
            sum += ret;
        }
        System.out.println(sum);
    }


    //利用for循环来求阶乘
    public static void main11(String[] args) {
        int sum = 1;
        for (int i = 1; i <= 5; i++) {
            sum *= i;
        }
        System.out.println(sum);
    }


    public static void main10(String[] args) {
        for (int m = 0; m < 10; m++) {
            System.out.println(m);
        }
    }

    //利用break来找整除的问题
    public static void main8(String[] args) {
        int i = 1;
        while(i <= 100) {
            while (i <= 100) {
                if (i % 15 == 0) {
                    break;
                }
                i++;
            }
            if(i <= 100) {
                System.out.println(i);
            }
            i++;
        }
    }

    //利用continue来找整除的问题
    public static void main7(String[] args) {
        int i = 1;
        while(i <= 100) {
            if(i % 3 == 0 && i % 5 == 0) {
                System.out.println(i);
                i++;
                continue;
            }
            i++;
        }
    }


    //计算阶乘   以及阶乘的和
    public static void main5(String[] args) {
        int i = 1;
        int j = 1;
        int sumMul = 1;
        int sum = 0;
        while(j <= 4) {
            while(i <= j) {
                sumMul *= i;
                i++;
            }
            sum += sumMul;
            j++;
        }
        System.out.println(sum);
    }
    //计算阶乘
    public static void main6(String[] args) {
        int i = 1;
        int sumMUL = 1;
        while(i <= 5) {
            sumMUL *= i;
            i++;
        }
        System.out.println(sumMUL);
    }

    //1到100的和  或者奇数和
    public static void main4(String[] args) {
        int i = 0;
        int sum = 0;
        while (i <= 100) {
            sum += i;
            i++;
        }
        System.out.println(sum);

        i = 1;
        sum = 0;
        while (i <= 100) {
            sum += i;
            i = i + 2;
        }
        System.out.println(sum);

    }


    //while循环语句
    public static void main3(String[] args) {
        int i = 1;
        while(i <= 10) {
            System.out.println(i);
             i++;
        }
    }


//    练习switch语句
//    常问问题：不能做switch语句参数的数据类型是什么？
//     long float double boolean
    public static void main2(String[] args) {
        int a = 10;
        switch(a) {
            case 1:
                System.out.println("1");
                break;
            case 2:
                System.out.println("2");
                break;
            default:
                System.out.println("输入有误");
                break;
        }
    }

    //判断闰年平年情况
    public static void main1(String[] args) {
        int year = 2016;
        int a = 0;
        if((year % 4 == 0 && year % 100 != 0)) {
            System.out.println("闰年");
        }else if(year % 100 == 0 && year % 400 == 0 ) {
            System.out.println("闰年");
        }else {
            System.out.println("平年");
        }
    }
}
